Skip to content

IDE: Improve display of the documentation on hover #5394

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Nov 13, 2018

Conversation

Duhemm
Copy link
Contributor

@Duhemm Duhemm commented Nov 6, 2018

screenshot 2018-11-06 at 10 06 47


/** A mapping from tag name to `TagFormatter` */
private val knownTags: ListMap[String, TagFormatter] = ListMap(
"@tparam" -> TagFormatter("Type Parameters", toDescriptionList),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like something that could be useful when displaying documentation outside of the IDE e.g. in the repl, or even to generate the dottydoc output. Can we move it to compiler/ ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've moved it to dotty.tools.dotc.util

@Duhemm Duhemm force-pushed the topic/ide-better-doc branch from 02ea0b7 to f0af0bb Compare November 8, 2018 08:36
@odersky
Copy link
Contributor

odersky commented Nov 8, 2018

Looks neat!

@Duhemm Duhemm force-pushed the topic/ide-better-doc branch from c778d46 to 534262d Compare November 9, 2018 15:11
@Duhemm Duhemm force-pushed the topic/ide-better-doc branch from 3972d91 to d687932 Compare November 12, 2018 08:28
@Duhemm
Copy link
Contributor Author

Duhemm commented Nov 12, 2018

@smarter I just pushed the changes you suggested. VSCode shows just a little more space than I wish it did, but I think overall it's better

screenshot 2018-11-12 at 09 28 49

I've also made the changes you suggested to display the documentation in the REPL.

@Duhemm Duhemm force-pushed the topic/ide-better-doc branch from d687932 to c20fb75 Compare November 12, 2018 08:55
@smarter
Copy link
Member

smarter commented Nov 12, 2018

VSCode shows just a little more space than I wish it did, but I think overall it's better

Maybe we could just use bold then ? I haven't tried it

* prepending `####`.
*/
private def heading(str: String)(implicit ctx: Context): String = {
if (colorEnabled) s"$UNDERLINED$str$RESET"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you played with using bold instead of with underlined ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed it to bold, that looks great too 😄

This commit introduces `ParsedComment` which is used to parse the doc
comments and make it easier to retrieve parts of the comments (for
instance, the documentation associated with a given method parameter).

The documentation marked with the tags that scaladoc supports are
extracted and their content are formatted into lists, code fences, etc.
@Duhemm Duhemm force-pushed the topic/ide-better-doc branch from c20fb75 to cc1b7fa Compare November 13, 2018 07:48
@Duhemm
Copy link
Contributor Author

Duhemm commented Nov 13, 2018

Writing the titles in bold rather than #### puts a lot less space between them, which is better 👍

screenshot 2018-11-13 at 08 38 55

@Duhemm Duhemm merged commit e27b6fa into scala:master Nov 13, 2018
@Duhemm Duhemm deleted the topic/ide-better-doc branch November 13, 2018 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants